Skip to content

Conversation

@pamelap-nvidia
Copy link
Collaborator

@pamelap-nvidia pamelap-nvidia commented Oct 8, 2025

Support quantized phi4 MM models

Added tests for FP4 and FP8 ckpts.

Summary by CodeRabbit

  • New Features

    • Added FP4 and FP8 variants for Phi-4 Multimodal Instruct (image, audio, image+audio).
    • Improved loading of quantized weights with per-projection scaling for better robustness.
    • More flexible model import resolution for multimodal models.
  • Documentation

    • Added accuracy references for FP4/FP8 on GSM8K and MMLU.
  • Tests

    • Expanded accuracy and end-to-end coverage for FP4/FP8, including multi-GPU, KV-cache reuse, and chunked prefill.
    • Added performance mappings for FP4/FP8 variants and corresponding LoRA paths.
  • Chores

    • Updated test lists and identifiers for consistency.

Description

Test Coverage

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

@pamelap-nvidia
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20777 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20777 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #15705 completed with status: 'SUCCESS'

@farazkh80
Copy link
Collaborator

farazkh80 commented Oct 8, 2025

Hey @pamelap-nvidia great work, could we maybe add a e2e test on b200s? on sm120 post merge would be nice too.

AFAIR, these changes also unblocked phi4-reason-plus fp4 as well when we did for spark-dev branch. Might be good to test that too.

@pamelap-nvidia pamelap-nvidia marked this pull request as ready for review October 14, 2025 06:50
@pamelap-nvidia pamelap-nvidia requested review from a team as code owners October 14, 2025 06:50
@pamelap-nvidia
Copy link
Collaborator Author

/bot run --extra-stage "RTXPro6000-PyTorch-Post-Merge-1,RTXPro6000-4_GPUs-PyTorch-Post-Merge-1,RTXPro6000-4_GPUs-PyTorch-Post-Merge-2"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21325 [ run ] triggered by Bot

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

📝 Walkthrough

Walkthrough

Updates weight-loading logic for Phi-3 (QKV and MLP gate/up with scale handling), modifies Phi-4MM dynamic import and base-layer key remapping, adjusts multimodal input modality handling, and expands tests and references to include FP4/FP8 variants across accuracy, perf, e2e, and test lists.

Changes

Cohort / File(s) Summary
Phi3 weight loading
tensorrt_llm/_torch/models/modeling_phi3.py
Refactors QKV split using explicit indices; adds per-part handling for weight_scale, input_scale, weight_scale_2; adds gate_up split with analogous scaling propagation.
Phi4MM import and weight remap
tensorrt_llm/_torch/models/modeling_phi4mm.py
Introduces runtime package_name-based import for hf module; extends base-layer key remapping to include weight/input_scale/weight_scale/weight_scale_2 in load paths for LM and non-LM classes.
Input utils modality handling
tensorrt_llm/inputs/utils.py
Changes modality remap via mdata_modality for multiple_image→image; condition references undefined variable modality, potentially causing NameError; input_scale path unchanged.
Accuracy references
tests/integration/defs/accuracy/references/gsm8k.yaml, .../mmlu.yaml
Adds FP8 and NVFP4 accuracy entries for microsoft/Phi-4-multimodal-instruct.
Accuracy tests
tests/integration/defs/accuracy/test_llm_api_pytorch.py
Adds TestPhi4MM tests: test_fp4 (skip_pre_blackwell) and test_fp8 (skip_pre_hopper).
Perf test mappings
tests/integration/defs/perf/test_perf.py
Adds MODEL_PATH_DICT and LORA_MODEL_PATH entries for Phi-4 FP4/FP8 (image/audio).
E2E tests
tests/integration/defs/test_e2e.py
Extends parametrization to include FP4/FP8 variants; adds model_name/model_path args; updates startswith checks; expands expected keywords and KV-cache scenarios; adjusts skips.
QA test lists
tests/integration/test_lists/qa/llm_function_core.txt, .../llm_function_l20.txt, .../llm_function_rtx6k.txt
Appends FP4/FP8 accuracy and multimodal quickstart cases; updates/extends Phi-4MM entries.
Test DB lists
tests/integration/test_lists/test-db/l0_l40s.yml, .../l0_rtx_pro_6000.yml
Replaces/extends multimodal quickstart entries with Phi-4 identifiers; adds FP4/FP8 quickstart and accuracy tests.
Waivers list
tests/integration/test_lists/waives.txt
Renames two identifiers to lowercase phi4-multimodal-instruct.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Loader as WeightLoader (Phi3)
  participant State as StateDict
  participant Layer as Attention/MLP Layer

  Note over Loader,Layer: QKV loading with per-part scales
  Loader->>State: get qkv_weight, weight_scale, input_scale, weight_scale_2
  alt explicit indices
    Loader->>Loader: split q[:qk], k[qk:kv], v[kv:]
  end
  alt weight_scale dims match qkv
    Loader->>Layer: set q/k/v weights with respective weight_scale slices
  else shared scale
    Loader->>Layer: set q/k/v weights with shared weight_scale
  end
  opt input_scale / weight_scale_2 present
    Loader->>Layer: attach input_scale, weight_scale_2 to q/k/v
  end

  Note over Loader,Layer: gate_up split in MLP
  Loader->>State: get gate_up_weight (+scales)
  Loader->>Loader: split into gate, up
  alt weight_scale dims match
    Loader->>Layer: set gate/up with respective scale slices
  else shared scale
    Loader->>Layer: set gate/up with shared scale
  end
  opt input_scale / weight_scale_2 present
    Loader->>Layer: attach to gate/up
  end
Loading
sequenceDiagram
  autonumber
  participant Init as Phi4MM Init
  participant FS as Filesystem
  participant Import as Importlib
  participant Model as Phi4MM Model

  Note over Init,Import: Dynamic module resolution
  Init->>FS: derive package_name from local_path
  Init->>Import: import {package_name}.modeling_phi4mm as hf_modeling_phi4mm
  Import-->>Init: module

  Note over Init,Model: Base-layer key remap on load
  Init->>Model: load_weights(state_dict)
  Model->>Model: for k in keys: replace "base_layer.{layer}" with "{layer}" for {weight,input_scale,weight_scale,weight_scale_2}
  Model-->>Init: weights loaded
Loading
sequenceDiagram
  autonumber
  participant Util as convert_to_conversation_message
  participant Tracker as mm_data_tracker

  Util->>Util: mdata is dict? extract modality->mdata_modality
  Util->>Util: if mdata_modality == "multiple_image" set to "image"
  Util->>Tracker: add_data(mdata_modality, data)
  Note over Util: Current patch references undefined "modality" in condition path (potential NameError)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description only contains a brief note and the raw template instructions without filling out the required 'Description' and 'Test Coverage' sections, so it lacks necessary details on the changes implemented and how they are tested. Please fill in the 'Description' section with a concise summary of the changes and their rationale, and complete the 'Test Coverage' section by listing tests added or updated to validate the new quantized FP4 and FP8 pathways.
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title follows the NVBugs template exactly and clearly summarizes the addition of quantized Phi4 multimodal support, matching the main changes in the patch.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
tensorrt_llm/_torch/models/modeling_phi4mm.py (1)

1-1: Add SPDX header (compliance).

Prepend the NVIDIA Apache-2.0 copyright header with current year to this Python file.

Apply at file top:

+# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+#

As per coding guidelines

tensorrt_llm/_torch/models/modeling_phi3.py (1)

1-1: Add SPDX header (compliance).

Prepend the NVIDIA Apache-2.0 header to this source file.

+# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+#

As per coding guidelines

tensorrt_llm/inputs/utils.py (1)

583-590: Fix modality remap for multiple-image (also for embeddings); use per-item modality.

Current code checks the outer loader modality and only remaps for data, not embeddings. For multiple_image embeddings this will produce unknown modality in placeholder lookup. Normalize by item and apply to both paths.

Apply:

-                mdata_modality = mdata["modality"]
-                if modality == "multiple_image":
-                    mdata_modality = "image"
-                mm_data_tracker.add_data(mdata_modality, mdata["data"])
+                mdata_modality = mdata["modality"]
+                if mdata_modality == "multiple_image":
+                    mdata_modality = "image"
+                mm_data_tracker.add_data(mdata_modality, mdata["data"])
             else:
                 # Add embeddings to the tracker for placeholder handling
-                mm_data_tracker.add_data(mdata["modality"],
-                                         mdata["mm_embedding_info"])
+                em_modality = mdata["modality"]
+                if em_modality == "multiple_image":
+                    em_modality = "image"
+                mm_data_tracker.add_data(em_modality,
+                                         mdata["mm_embedding_info"])
🧹 Nitpick comments (3)
tensorrt_llm/_torch/models/modeling_phi4mm.py (1)

1005-1007: Derive mm_token_ids device from model params to avoid mismatches.

Using self.device may be undefined or on a different device than the model/inputs. Bind to the LLM’s actual parameter device.

Apply:

-        self.mm_token_ids = torch.tensor(
-            [_IMAGE_SPECIAL_TOKEN_ID, _AUDIO_SPECIAL_TOKEN_ID],
-            device=self.device)
+        device = next(self.llm.parameters()).device
+        self.mm_token_ids = torch.tensor(
+            [_IMAGE_SPECIAL_TOKEN_ID, _AUDIO_SPECIAL_TOKEN_ID],
+            device=device)
tensorrt_llm/inputs/utils.py (1)

603-611: Minor: avoid shadowing built-in name input.

Rename local variable input to inputs_dict or payload to improve readability.

-        input = {"prompt": prompt}
-        if mm_placeholder_counts:
-            if mm_embeddings is not None:
-                input[
-                    "multi_modal_embeddings"] = mm_data_tracker.retrieve_all_sync(
-                    )
-            else:
-                input["multi_modal_data"] = mm_data_tracker.retrieve_all_sync()
-        inputs.append(input)
+        inputs_dict = {"prompt": prompt}
+        if mm_placeholder_counts:
+            if mm_embeddings is not None:
+                inputs_dict["multi_modal_embeddings"] = mm_data_tracker.retrieve_all_sync()
+            else:
+                inputs_dict["multi_modal_data"] = mm_data_tracker.retrieve_all_sync()
+        inputs.append(inputs_dict)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (1)

3286-3303: Add quant-algo assertions for early validation.

Assert the expected quantization for FP4/FP8 variants to catch misconfigured paths faster.

     @skip_pre_blackwell
     def test_fp4(self):
         model_path = f"{self.MODEL_PATH}-FP4"
         with LLM(model_path, max_seq_len=4096) as llm:
+            assert llm.args.quant_config.quant_algo == QuantAlgo.NVFP4
             task = MMLU(self.MODEL_NAME)
             task.evaluate(llm)
             task = GSM8K(self.MODEL_NAME)
             task.evaluate(llm)

     @skip_pre_hopper
     def test_fp8(self):
         model_path = f"{self.MODEL_PATH}-FP8"
         with LLM(model_path, max_seq_len=4096) as llm:
+            assert llm.args.quant_config.quant_algo == QuantAlgo.FP8
             task = MMLU(self.MODEL_NAME)
             task.evaluate(llm)
             task = GSM8K(self.MODEL_NAME)
             task.evaluate(llm)
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72d65d0 and 60895b0.

📒 Files selected for processing (14)
  • tensorrt_llm/_torch/models/modeling_phi3.py (2 hunks)
  • tensorrt_llm/_torch/models/modeling_phi4mm.py (3 hunks)
  • tensorrt_llm/inputs/utils.py (1 hunks)
  • tests/integration/defs/accuracy/references/gsm8k.yaml (1 hunks)
  • tests/integration/defs/accuracy/references/mmlu.yaml (1 hunks)
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py (1 hunks)
  • tests/integration/defs/perf/test_perf.py (2 hunks)
  • tests/integration/defs/test_e2e.py (18 hunks)
  • tests/integration/test_lists/qa/llm_function_core.txt (2 hunks)
  • tests/integration/test_lists/qa/llm_function_l20.txt (2 hunks)
  • tests/integration/test_lists/qa/llm_function_rtx6k.txt (2 hunks)
  • tests/integration/test_lists/test-db/l0_l40s.yml (1 hunks)
  • tests/integration/test_lists/test-db/l0_rtx_pro_6000.yml (2 hunks)
  • tests/integration/test_lists/waives.txt (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Use only spaces, no tabs; indent with 4 spaces.

Files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tensorrt_llm/_torch/models/modeling_phi4mm.py
  • tensorrt_llm/_torch/models/modeling_phi3.py
  • tests/integration/defs/perf/test_perf.py
  • tensorrt_llm/inputs/utils.py
  • tests/integration/defs/test_e2e.py
**/*.py

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.py: Python code must target Python 3.8+.
Indent Python code with 4 spaces; do not use tabs.
Maintain module namespace when importing; prefer 'from package.subpackage import foo' then 'foo.SomeClass()' instead of importing the class directly.
Python filenames should be snake_case (e.g., some_file.py).
Python classes use PascalCase names.
Functions and methods use snake_case names.
Local variables use snake_case; prefix 'k' for variables that start with a number (e.g., k_99th_percentile).
Global variables use upper SNAKE_CASE prefixed with 'G' (e.g., G_MY_GLOBAL).
Constants use upper SNAKE_CASE (e.g., MY_CONSTANT).
Avoid shadowing variables from an outer scope.
Initialize all externally visible members of a class in the constructor.
Prefer docstrings for interfaces that may be used outside a file; comments for in-function or file-local interfaces.
Use Google-style docstrings for classes and functions (Sphinx-parsable).
Document attributes and variables inline so they render under the class/function docstring.
Avoid reflection when a simpler, explicit approach suffices (e.g., avoid dict(**locals()) patterns).
In try/except, catch the most specific exceptions possible.
For duck-typing try/except, keep the try body minimal and use else for the main logic.

Files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tensorrt_llm/_torch/models/modeling_phi4mm.py
  • tensorrt_llm/_torch/models/modeling_phi3.py
  • tests/integration/defs/perf/test_perf.py
  • tensorrt_llm/inputs/utils.py
  • tests/integration/defs/test_e2e.py
**/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).

Files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tensorrt_llm/_torch/models/modeling_phi4mm.py
  • tensorrt_llm/_torch/models/modeling_phi3.py
  • tests/integration/defs/perf/test_perf.py
  • tensorrt_llm/inputs/utils.py
  • tests/integration/defs/test_e2e.py
🧠 Learnings (1)
📚 Learning: 2025-09-17T02:48:52.732Z
Learnt from: tongyuantongyu
PR: NVIDIA/TensorRT-LLM#7781
File: tests/integration/test_lists/waives.txt:313-313
Timestamp: 2025-09-17T02:48:52.732Z
Learning: In TensorRT-LLM, `tests/integration/test_lists/waives.txt` is specifically for waiving/skipping tests, while other test list files like those in `test-db/` and `qa/` directories are for different test execution contexts (pre-merge, post-merge, QA tests). The same test appearing in both waives.txt and execution list files is intentional - the test is part of test suites but will be skipped due to the waiver.

Applied to files:

  • tests/integration/test_lists/waives.txt
🧬 Code graph analysis (2)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (2)
tensorrt_llm/llmapi/llm.py (1)
  • LLM (1084-1100)
tests/integration/defs/accuracy/accuracy_core.py (4)
  • MMLU (317-331)
  • evaluate (184-247)
  • evaluate (765-775)
  • GSM8K (334-349)
tests/integration/defs/test_e2e.py (2)
tensorrt_llm/llmapi/llm_args.py (1)
  • model_name (1363-1364)
tests/integration/defs/disaggregated/test_disaggregated_single_gpu.py (1)
  • model_path (75-80)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Pre-commit Check
🔇 Additional comments (16)
tests/integration/test_lists/qa/llm_function_rtx6k.txt (2)

22-25: Good coverage expansion for Phi4MM accuracy.

Entries align with added tests. Please confirm node ids match pytest param ids after collection.


48-56: E2E multimodal params look consistent with new signature.

Looks right. Verify collected ids match these strings (collect-only) to avoid list drift.

tests/integration/test_lists/test-db/l0_l40s.yml (1)

25-27: Renamed Phi4MM tests look correct.

Matches updated model_name/model_path/modality tuple usage.

tests/integration/test_lists/waives.txt (1)

352-353: Waivers updated to new Phi4MM ids.

Consistent with the intent of waives.txt to skip tests while keeping them listed elsewhere. Based on learnings

tests/integration/defs/accuracy/references/mmlu.yaml (1)

297-300: Added reference accuracies for Phi‑4 MM FP8/NVFP4.

Looks fine. Please record dataset/seed and eval config used to generate these for reproducibility.

tests/integration/test_lists/test-db/l0_rtx_pro_6000.yml (1)

38-40: Adds Phi4MM FP4/FP8 tests and 2‑GPU variants.

Looks good. Please sanity‑check pytest collection so ids match these entries.

Also applies to: 44-45, 110-111

tests/integration/defs/test_e2e.py (2)

2777-2782: LGTM on FP4/FP8 support and Phi4MM handling.

  • startswith('phi4‑multimodal‑instruct') gating looks good.
  • Param expansions for model_name/model_path consistent across tests.

Also applies to: 2960-2965, 2981-2992, 3179-3185, 3194-3195


2659-2666: LGTM on added KV‑reuse/chunked‑prefill coverage and expectations.

Additions are coherent with new variants and skip rules.

Also applies to: 2685-2688, 2741-2756, 2810-2816, 2835-2838, 2916-2944

tensorrt_llm/_torch/models/modeling_phi4mm.py (2)

91-116: Dynamic module name: check import stability with hyphenated package names.

Deriving package_name from the folder is fine. Please verify that relative imports in HF’s modeling_phi4mm.py still resolve when package_name contains hyphens (e.g., Phi-4-multimodal-instruct[-FP4]) and that repeated loads don’t collide in sys.modules.


991-1001: Base-layer key remap looks good.

Mapping base_layer.{weight,input_scale,weight_scale,weight_scale_2} → direct keys simplifies load_weights and aligns with Phi3 handling.

Please double-check for accidental key collisions when both base_layer.* and non-base-layer keys coexist in the same module path.

tensorrt_llm/_torch/models/modeling_phi3.py (1)

220-229: Q/K/V split boundaries look correct.

q: [:hidden_size], k: [hidden_size:hidden_size+num_kv_heads*head_dim], v: [rest] matches expected shapes.

tests/integration/defs/perf/test_perf.py (2)

130-137: Perf model-path additions look consistent.

New phi-4 multimodal FP4/FP8 entries align with existing naming and local repo layout.


188-195: LoRA-path additions look correct.

LoRA directories for FP4/FP8 variants mirror the base model entries.

tests/integration/test_lists/qa/llm_function_core.txt (1)

602-604: LGTM — core QA list updated for Phi‑4 MM FP4/FP8.

Entries align with new tests and naming.

Also applies to: 667-675, 677-686, 689-691

tests/integration/defs/accuracy/references/gsm8k.yaml (1)

190-193: MMLU references for Phi-4 MM FP8/NVFP4 confirmed
Entries for microsoft/Phi-4-multimodal-instruct with both quant_algo: FP8 and quant_algo: NVFP4 exist in tests/integration/defs/accuracy/references/mmlu.yaml.

tests/integration/test_lists/qa/llm_function_l20.txt (1)

44-46: LGTM — coverage extended to Phi-4 MM FP4/FP8 and end-to-end tests. Tests TestPhi4MM.test_fp4/test_fp8 and test_ptp_quickstart_multimodal_phi4mm entries confirmed present.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21325 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #16095 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check the rerun report for details.

@pamelap-nvidia
Copy link
Collaborator Author

/bot run --extra-stage "RTXPro6000-PyTorch-Post-Merge-1,RTXPro6000-4_GPUs-PyTorch-Post-Merge-1,RTXPro6000-4_GPUs-PyTorch-Post-Merge-2"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21563 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21563 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #16277 completed with status: 'FAILURE'

Copy link
Collaborator

@amukkara amukkara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pamelap-nvidia
Copy link
Collaborator Author

/bot run --extra-stage "RTXPro6000-PyTorch-Post-Merge-1,RTXPro6000-4_GPUs-PyTorch-Post-Merge-1,RTXPro6000-4_GPUs-PyTorch-Post-Merge-2"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21830 [ run ] triggered by Bot. Commit: b7a041f

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21830 [ run ] completed with state SUCCESS. Commit: b7a041f
/LLM/main/L0_MergeRequest_PR pipeline #16454 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check the rerun report for details.

@pamelap-nvidia pamelap-nvidia enabled auto-merge (squash) October 20, 2025 09:57
Signed-off-by: Pamela <[email protected]>

update tokenizer and processor

Signed-off-by: Pamela <[email protected]>

revert WAR for shapes

Signed-off-by: Pamela <[email protected]>

fix fp8 scale

Signed-off-by: Pamela <[email protected]>

fix image_audio

Signed-off-by: Pamela <[email protected]>
Signed-off-by: Pamela <[email protected]>
Signed-off-by: Pamela <[email protected]>
Signed-off-by: Pamela <[email protected]>
@pamelap-nvidia
Copy link
Collaborator Author

/bot reuse-pipeline

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21896 [ reuse-pipeline ] triggered by Bot. Commit: 872c7b2

@tensorrt-cicd
Copy link
Collaborator

PR_Github #21896 [ reuse-pipeline ] completed with state SUCCESS. Commit: 872c7b2
Reusing PR_Github #21830 for commit 872c7b2

@pamelap-nvidia pamelap-nvidia merged commit b818a91 into NVIDIA:main Oct 20, 2025
5 checks passed
govind-ramnarayan pushed a commit to nv-auto-deploy/TensorRT-LLM that referenced this pull request Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants